pre,
code,
kbd,
samp {
  font-family: $font-family-monospace;
  font-size: $font-size-sm;
  border-radius: $border-radius;
}

code {
  padding: 0.25rem 0.5rem;
}

pre {
  background: $beige;
  color: $black;
  margin: 2rem 0;
}

pre code {
  display: block;
  overflow-x: auto;
  line-height: $line-height-base;
  padding: 1.25rem 1.5rem;
  tab-size: 4;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.hljs {
  padding: 1.25rem 1.5rem;
}

@include media-breakpoint-down(sm) {
  pre,
  code,
  kbd,
  samp {
    border-radius: 0;
  }

  pre {
    margin: 2rem -1.5rem;
  }
}

pre code::-webkit-scrollbar {
  height: 5px;
}

pre code::-webkit-scrollbar-thumb {
  background: $gray-200;
}

pre code:hover {
  scrollbar-width: thin;
  scrollbar-color: $gray-200 transparent;
}

pre code::-webkit-scrollbar-thumb:hover {
  background: $gray-200;
}

pre code mark {
  display: block;
  width: 100%;
  padding: 0;
  color: inherit;
  box-shadow: none;
}

pre code table,
pre code table span {
  margin: 0;
  color: inherit;
}

pre code table tr > td {
  padding: 0;
  border-bottom: none;
}
pre code table tr > td:first-child {
  color: $gray-500;
  text-align: right;
  user-select: none;
  position: relative;
  transform: translateX(-1em);
}
pre code table tr > td:first-child > mark::after {
  position: absolute;
  display: block;
  content: "";
  right: -1em;
  top: 0;
  bottom: 0;
  width: 1em;
  background: inherit;
}
